<template>
  <h3>Son</h3>
  <p>{{ num }}</p>
  <button @click="update">更新</button>
</template>

<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  name: "Son",
  props: {
    num: {
      type: Number,
      required: true,
    },
  },
  methods: {
    update() {
      this.$emit("update:num", this.num + 2);
    },
  },
});
</script>

<style></style>
